<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
<script type="text/javascript">
$('#tt').tabs({
    border:false,
    onSelect:function(title){
		alert(title+' is selected');
    }
});

function tables(ll){
 	$('#sz_anpai').datagrid({    
 		//数据源地址
	   url:'shengzhianpaichaxun',
	 	queryParams:{
	 		empname:ll
		},
		    columns:[[    
		    	{field:'EMPNAME',fixed:false,width:180,title:'升职人姓名',align:'center'},    
		        {field:'POTZW',fixed:false,width:180,title:'个人升职意向',align:'center'},   
		        {field:'ZKZREM',fixed:false,width:180,title:'准考证',align:'center'},  
		        {field:'FEBMINTIME',fixed:false,width:180,title:'开考时间',align:'center',
		    		formatter : function(value){
		        		var d = new Date(value);
		        		var times=d.getFullYear() + '-' + (d.getMonth() + 1) + '-' + d.getDate() + ' ' + d.getHours() + ':' + d.getMinutes() + ':' + d.getSeconds();
		        		return times;
		        	}	
		        },    
		        {field:'FEBMAXTIME',fixed:false,width:180,title:'结束时间',align:'center',
		        	formatter : function(value){
		        		var d = new Date(value);
		        		var times=d.getFullYear() + '-' + (d.getMonth() + 1) + '-' + d.getDate() + ' ' + d.getHours() + ':' + d.getMinutes() + ':' + d.getSeconds();
		        		return times;
		        	}	
		        },
		        {field:'OUTSC',fixed:false,width:180,title:'考试时长',align:'center'},
		        {field:'JULDZ',fixed:false,width:180,title:'考试地点',align:'center'},
		        {field:'OUTNAME',fixed:false,width:180,title:'考试试卷',align:'center'}
	    ]],
	    pagination:true,
	    pageNumber:1,
	    pageSize:5,
	    pageList:[5,10,15]
	});
}
function shengzhisousuo(value,name){
	tables(value);
}
$(function(){
	//显示
	 $('#Shijuan').combobox({
		 url:'shijuan2',
		 valueField:'OUTID',
		 textField:'OUTNAME'
	 });
	
 	tables(null);
 	//点击编辑按钮显示窗口
	$(".sz_anpai").click(function(){
		 $("#sz_kaoshianpai").window("open");  
 	
 	   $('#sz_yixiangbiao').datagrid({    
 		//数据源地址
 	   url:'szapxingzeng',
	    columns:[[
	    	{field:'FEBID',fixed:false,width:180,checkbox:true,title:'个人意向编号',align:'center'},
	    	{field:'EMPNAME',fixed:false,width:180,title:'升职人姓名',align:'center'},   
	    	{field:'POTZW',fixed:false,width:180,title:'个人意向',align:'center'},    
	        {field:'ZKZREM',fixed:false,width:180,title:'准考证',align:'center'},
	        {field:'FEBMINTIME',fixed:false,width:180,title:'开考时间',align:'center'},
	        {field:'FEBMAXTIME',fixed:false,width:180,title:'结束时间',align:'center'},
	        {field:'JULDZ',fixed:false,width:180,title:'考试地址',align:'center'}
	    
	    ]],
	    pagination:true,
	    pageNumber:1,
	    pageSize:5,
	    pageList:[5,10,15]
	});
});
	
	 $(".sz_bao").click(function(){
			var rows=$('#sz_yixiangbiao').datagrid('getChecked');
			var outid = $("#Shijuan").val();
			for(var i=0;i<rows.length;i++){
				$.ajax({
					url:"updatekaoshianpai",
					type:"post",
					data:{"febid":rows[i]["FEBID"],"outid":outid},
					success:function(data){
						$("#sz_kaoshianpai").window("close");
						$( '#sz_anpai').datagrid('reload');
					}
				})
			} 
		});
})
 function add(text,url){
	if(url!=undefined){
		$('#tit').tabs('add',{
			id: 'tit1',
			title: text,
			closable: true,
			href: "http://localhost:8080/"+url
		});
	}
} 

$(".sz_qu").click(function(){
	$("#sz_kaoshianpai").window("close"); 
})

</script>
			    	   <div id="sz_kaoshianpai" class="easyui-window" title="考试安排" style="width:800px;height:550px"
		    		data-options="closed:true,minimizable:false,maximizable:false,collapsible:false,modal:true">
		    		             
		    		             <div class="sz_center">
		    		                    <table id="sz_yixiangbiao" class="easyui-datagrid" style="width:100%;height:330px;margin-top:10px;" data-options="fitColumns:true">
                               
                                        </table>
		    		             </div>
		    		             <div class="sz_bottom">
		    		                    <div class="sz_shijuankuang">
		    		                      <div class="sz_kaojuan">试卷名称：
		    		                      <input id="Shijuan" class="easyui-combobox shijuanshuru">
				                        
		    		                      </div>
		    		                   </div>
		    		             </div>
		    		             <div class="sz_anniu">
		    		                      <div class="sz_baocun"><button class="sz_bao"><img src="../static/tyl/images/go.png">保存</button></div>
		    		                      <div class="sz_quxiao"><button class="sz_qu"><img src="../static/tyl/images/cha.png">取消</button></div>
		    		             </div>
		    		           
				       </div>
				<div class="shengzhi_zong">
				
				    <div class="shengzhi_shang">
				              <div class="sz_xianshi">
				                  <button class="sz_anpai">考试安排</button>
				              </div>
				              <div class="sz_shanchu">
				                  <input id="ss" class="easyui-searchbox" style="width:300px" data-options="searcher:shengzhisousuo,prompt:'请输入需要查询的姓名'"></input>
				              </div>
				    </div>
				    <div class="shengzhi_xia">
				             <table id="sz_anpai" class="easyui-datagrid" style="width:100%;height:360px;margin-top:20px;" data-options="fitColumns:true">
                            </table>
				    </div>
				</div>
</body>
</html>